<?php
namespace app\shop\model;

use cubox\Model as biModel;

class Model extends biModel{
    public function getType($name = ''){
        $typeArr = [
            'cate'=>'分类',
            'goods' => '商品',
        ];

        if ($name){
            return $typeArr[$name];
        }else{
            return $typeArr;
        }
    }

    //保留字段名
    public function reservedField($type){
        $fieldList = [];
        $fieldList['cate'] = ['title','route','path','row'];
        $fieldList['goods'] = ['title','route','path','row','content','title_style','create_date','update_date'];
        return $fieldList[$type]??[];
    }
}